package com.sunda.spmsoversea.util;

import lombok.extern.slf4j.Slf4j;

import java.util.UUID;

/**
 * @program: spms
 * @description:
 * @author: Wayne Wu
 * @create: 2021-10-28 09:38
 **/
@Slf4j
public class createOverseaData {

    /**
     * 海外常用工厂仓库信息：GF02  2006；TF02  1006；ZM61  1004；
     * 装箱单号：SPL10000001
     * 交货单号：2000000001
     * 柜号：TGBU5570001
     * 物料编号	210008389	210008387	210008384	210051422	210051375	210053126	210052745	210022233	210037994
     * 基本单位	PCS	PCS	PCS	PCS	PCS	PCS	PCS	PCS	PCS
     * @param args
     */

    public static void main(String[] args) {
        int cabinetNumberAuto = 5570001;
        int deliveryNoteAuto = 2000000001;
        int packageListAuto = 10000001;
        long boxNoteAuto = 12345670001L;
        long purchaseNo = 5200000001L;
        for (; deliveryNoteAuto < 2000000031; deliveryNoteAuto++){
            String uuid1 = UUID.randomUUID().toString().toLowerCase().replaceAll("-", "");
            String uuid2 = UUID.randomUUID().toString().toLowerCase().replaceAll("-", "");

            String deliveryNote = String.valueOf(deliveryNoteAuto);
            String packageList = "SPL" + packageListAuto;
            String cabinetNumber = "TGBU" + cabinetNumberAuto;
            String boxNote1 = "SP-" + (boxNoteAuto) + "-0101";
            String boxNote2 = "SP-" + (boxNoteAuto + 1) + "-0101";

            System.out.println("\nINSERT INTO OVERSEA_DELIVERY_NOTE (UUID_DELIVERY_NOTE, SAP_DELIVERY_NOTE, SAP_PACKAGE_LIST, CABINET_NUMBER, DELIVERY_TYPE, SPMS_STATUS, WERKS_RECEIVE, WERKS_DELIVERY, CREATE_DATE, DATA_STATUS) " +
                    "VALUES ('" + uuid1 + "', '" + deliveryNote + "', '" + packageList + "', '" + cabinetNumber + "', 'ZNLC', '0', 'GF02', 'CN01', '2021-10-28', '0');");

            System.out.println("INSERT INTO OVERSEA_DELIVERY_NOTE_DTL (SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, MATERIAL_NO, BASIC_UNIT, UNIT_SALES, RECEIVABLE_QTY_BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, PURCHASE_NO, PURCHASE_NO_ITEM, WERKS_DELIVERY, WHS_LOCATION_CODE_DELIVERY, WERKS_RECEIVE, MOVEMENT_TYPE, DATA_STATUS) " +
                    "VALUES ('" + deliveryNote + "', '10', '210008389', 'PCS', 'PCS', '20', '20', '" + purchaseNo + "', '10', 'CN01', '1061', 'GF02', '643', '0');");
            System.out.println("INSERT INTO OVERSEA_DELIVERY_NOTE_DTL (SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, MATERIAL_NO, BASIC_UNIT, UNIT_SALES, RECEIVABLE_QTY_BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, PURCHASE_NO, PURCHASE_NO_ITEM, WERKS_DELIVERY, WHS_LOCATION_CODE_DELIVERY, WERKS_RECEIVE, MOVEMENT_TYPE, DATA_STATUS) " +
                    "VALUES ('" + deliveryNote + "', '20', '210008387', 'PCS', 'PCS', '30', '30', '" + purchaseNo + "', '20', 'CN01', '1061', 'GF02', '643', '0');");
            System.out.println("INSERT INTO OVERSEA_DELIVERY_NOTE_DTL (SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, MATERIAL_NO, BASIC_UNIT, UNIT_SALES, RECEIVABLE_QTY_BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, PURCHASE_NO, PURCHASE_NO_ITEM, WERKS_DELIVERY, WHS_LOCATION_CODE_DELIVERY, WERKS_RECEIVE, MOVEMENT_TYPE, DATA_STATUS) " +
                    "VALUES ('" + deliveryNote + "', '30', '210008384', 'PCS', 'PCS', '40', '40', '" + purchaseNo + "', '30', 'CN01', '1061', 'GF02', '643', '0');");

            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST (UUID_PACKAGE_LIST, SAP_PACKAGE_LIST, MERCHANDISER, CABINET_MODEL, FROM_PORT, TO_PORT, DATA_STATUS) " +
                    "VALUES ('" + uuid2 + "', '" + packageList + "', '张三', '20GP', 'CNNSA', 'GHTEM', '0');");

            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, SAP_DELIVERY_NOTE, PURCHASE_NO, PURCHASE_NO_ITEM, DATA_STATUS) " +
                    "VALUES ('" + packageList + "', '10', '" + deliveryNote + "', '" + purchaseNo + "', '10', '0');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, SAP_DELIVERY_NOTE, PURCHASE_NO, PURCHASE_NO_ITEM, DATA_STATUS) " +
                    "VALUES ('" + packageList + "', '20', '" + deliveryNote + "', '" + purchaseNo + "', '20', '0');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, SAP_DELIVERY_NOTE, PURCHASE_NO, PURCHASE_NO_ITEM, DATA_STATUS) " +
                    "VALUES ('" + packageList + "', '30', '" + deliveryNote + "', '" + purchaseNo + "', '30', '0');");

            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE, BOX_STATUS, DATA_STATUS) " +
                    "VALUES ('" + packageList + "', '10', '" + boxNote1 + "', '0', '0');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE, BOX_STATUS, DATA_STATUS) " +
                    "VALUES ('" + packageList + "', '20', '" + boxNote1 + "', '0', '0');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE, BOX_STATUS, DATA_STATUS) " +
                    "VALUES ('" + packageList + "', '30', '" + boxNote2 + "', '0', '0');");

            cabinetNumberAuto ++;
            packageListAuto ++;
            purchaseNo ++;
            boxNoteAuto += 2;
        }
    }

}
